Repository navigation
fix(id/world): keep minted display names restorable at the 48-char boundary - #4727
Merged
Merged
Conversation
…undary (#4711) sanitize_display_name now trims after the 48-char truncation, so every minted name is a fixed point of the sanitizer (previously a name whose 48th char was whitespace was minted with trailing whitespace and then refused by the #2960 restore check, bricking the journal). Restore also accepts names the pre-fix mint could have produced (is_pre_fix_mint_display_name) so journals already written with boundary names remain restorable, while still refusing empty, control-bearing, over-length, and otherwise unproducible names. Tests: sanitizer boundary shapes (space / double space / U+00A0 at the cap), pre-fix producibility predicate, and restore-level cases for pre-fix boundary journals and freshly minted boundary inputs.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 39 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. CodeRabbit Verify
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4711 (task 6696).
Problem
sanitize_display_nametrimmed before the 48-char cap, so truncation landing on a whitespace character minted a 48-char name ending in whitespace — a fixed point of neither sanitizer — and the #2960 restore check then refused the whole journal ("a display name mint could not have produced").Change
sanitize_display_namenow trims again after truncation, via the extractedpre_fix_sanitize_display_name(the old algorithm, kept for journal compatibility), so every minted name is a fixed point of itself.is_pre_fix_mint_display_name: an exact characterization of pre-fix mint outputs (no control/format chars, no leading whitespace, ≤48 chars, and fully trimmed unless exactly 48 chars). Journals already written with boundary names stay restorable; empty, control-bearing, over-length, and short-but-untrimmed names are still refused.Tests (laptop,
pkgs/id,cargo test --lib)world::utilsuite: 12 passed — new boundary tests (space / double space / U+00A0 at the cap, fixed-point property, pre-fix predicate accept/refuse cases) plus all pre-existing sanitizer tests including the id(world): sanitize_display_name takes its 48 characters before trimming — leading spaces spend the budget, so a padded name is truncated to its first letters or refused as empty #3709 leading-padding cases.restore_*suite: 6 passed — the id(world): journal restore never sanitizes Issued display names — empty, control-bearing, and over-length names restore verbatim, though mint refuses or strips all three #2960 restore test now also covers a pre-fix boundary journal (47 chars + trailing space at exactly 48) restoring, and a freshly minted boundary input trimming at mint and restoring.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.